#define _CRT_SECURE_NO_WARNINGS 1		
#include"SEQlist.h"
void seqlistinit(seqlist* ps)
{
	ps->array =NULL;
	ps->size = 0;
	ps->capacity = 0;
}
void seqlistpush(seqlist* ps, seqlisttype x)
{
	if (ps->size == ps->capacity)
	{
		if (ps->capacity == 0)
		{
			ps->capacity = 1;
			ps->array = realloc(ps->array, ps->capacity * 2 * sizeof(seqlisttype));
			ps->capacity *= 2;
		}
		else
		{
			ps->array = realloc(ps->array, ps->capacity * 2 * sizeof(seqlisttype));
			ps->capacity *= 2;
		}
		
	}
		ps->array[ps->size] = x;
		ps->size++;
}
void seqlistpop(seqlist* ps)
{
	ps->size--;
}
seqlisttype seqlistfind(seqlist* ps, int position)
{
	int position2 = position;
	assert(position2 < ps->size);
	return ps->array[position2];
}
void seqlistprintf(seqlist* ps)
{
	for (int i = 0; i < ps->size; i++)
	{
		printf("%d ", ps->array[i]);
	}
}